<?php

/**
 * @filesource Acts as a medium between the viewStudent.php file and the
 * dbStudent.php file.
 *
 * @copyright 2011 by Dan, Steven, Brice, Mike, and Aaron.  This program is part
 * of Internship 2 Career, which is free software. It comes with absolutely no
 * warranty. You can redistribute or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation (For
 * more information, see <http://www.gnu.org/licenses/).
 *
 * @version February 10, 2011
 *
 * @author Steven Simard
 */

/**
 * Represents student data stored in the dbStudent table.
 */
class Student {

    /**
     * Represents student information that corresponds to the student table
     * in the database
     */
    private $studentID;
    private $fname;
    private $lname;
    private $username;
    private $currentGPA;
    private $major;
    private $yearStatus;
    private $graduationYear;
    private $gotHired;

    function __construct($fname, $lname, $username, $currentGPA, $major,
            $yearStatus, $graduationYear, $gotHired) {
        $this->studentID = null;
        $this->fname = $fname;
        $this->lname = $lname;
        $this->username = $username;
        $this->currentGPA = $currentGPA;
        $this->major = $major;
        $this->yearStatus = $yearStatus;
        $this->graduationYear = $graduationYear;
        $this->gotHired = $gotHired;
    }

    /**
     * Sets this student's ID name to the specified argument value.
     * @param string $ID The ID value to be assigned to this object.
     */
    function setStudentID($studentID) {
        $this->studentID = $studentID;
    }

    /**
     * Sets this student's first name to the specified argument value.
     * @param string $fname The first name value to be assigned to this object.
     */
    function setFName($fname) {
        $this->fname = $fname;
    }

    /**
     * Sets this student's last name to the specified argument value.
     * @param string $LName The last name value to be assigned to this object.
     */
    function setLName($lname) {
        $this->lname = $lname;
    }

    /**
     * Sets this student's username to the specified argument value.
     * @param string $username The username value to be assigned to this object.
     */
    function setUsername($username) {
        $this->username = $username;
    }

    /**
     * Sets this student's current GPA to the specified argument value.
     * @param string $currentGPA The current GPA value to be assigned to this
     * object.
     */
    function setCurrentGPA($currentGPA) {
        $this->currentGPA = $currentGPA;
    }

    /**
     * Sets this student's major to the specified argument value.
     * @param string $major The major value to be assigned to this object.
     */
    function setMajor($major) {
        $this->major = $major;
    }

    /**
     * Sets this student's year/status to the specified argument value.
     * @param string $yearStatus The year/status value to be assigned to this
     * object.
     */
    function setYearStatus($yearStatus) {
        $this->yearStatus = $yearStatus;
    }

    /**
     * Sets this student's graduation year to the specified argument value.
     * @param string $graduationYear The graduation year value to be assigned to
     * this object.
     */
    function setGraduationYear($graduationYear) {
        $this->graduationYear = $graduationYear;
    }

    /**
     * Sets this student's hired status to the specified argument value.
     * @param string $gotHired
     */
    function setGotHired($gotHired) {
        $this->gotHired = $gotHired;
    }

    /**
     * Returns the ID of this student.
     * @return The ID of this student.
     */
    function getStudentID() {
        return $this->studentID;
    }

    /**
     * Returns the first name of this student.
     * @return The FName of this student.
     */
    function getFname() {
        return $this->fname;
    }

    /**
     * Returns the last name of this student.
     * @return The LName of this student.
     */
    function getLname() {
        return $this->lname;
    }

    /**
     * Returns the username of this student.
     * @return The Username of this student.
     */
    function getUsername() {
        return $this->username;
    }

    /**
     * Returns the current GPA of this student.
     * @return The CurrentGPA of this student.
     */
    function getCurrentGPA() {
        return $this->currentGPA;
    }

    /**
     * Returns the major of this student.
     * @return The Major of this student.
     */
    function getMajor() {
        return $this->major;
    }

    /**
     * Returns the year/status of this student.
     * @return The YearStatus of this student.
     */
    function getYearStatus() {
        return $this->yearStatus;
    }

    /**
     * Returns the the graduation year of the student
     * @return The graduationYear of this student.
     */
    function getGraduationYear() {
        return $this->graduationYear;
    }

    /**
     * Returns if the student got hired or not
     * @return status of hired
     */
    function getGotHired() {
        return $this->gotHired;
    }

    function printAllAttributes() {
        $output = sprintf("First Name: %s, Last Name: %s, Username: %s,
            Current GPA: %f, Major: %s, Year Status: %s, Graduation Year: %s,
            Got Hired: %s.",
                        $this->fname, $this->lname, $this->username,
                        $this->currentGPA, $this->major, $this->yearStatus,
                        $this->graduationYear, $this->gotHired);
        return $output;
    }
}

?>